﻿using System;

namespace YArchitech.Plumbing
{
	public class AirConditionUsedCalculate : UsedWaterCalculate
	{
		public AirConditionUsedCalculate(string name) : base(WaterCalculateType.AirCondition, name)
		{
		}

		public override bool Calculate()
		{
			bool result = false;
			try
			{
				if (this.coefficientProposal != 0.0)
				{
					this.aveUserPerHour = this.maxUsedPerHour / this.coefficientProposal;
					this.maxUsedPerDay = this.aveUserPerHour * this.usedTimeProposal;
					result = true;
				}
			}
			catch (Exception ex)
			{
				ex.ToString();
			}
			return result;
		}
	}
}
